package com.icss.lesson3;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class TestMain5 {
    public static void main(String[] args) {
        try (
                OutputStream os = new FileOutputStream("D:/a.txt", true);
            ) {

            // 字符串的。getBytes(); 字符串转换成字节数组
            os.write("hello world".getBytes());
            os.flush();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
